package cn.jobstart.enums;

/**
*    @author sunke
*    @Date 2023-09-20 23:34:50
*    @description 工作经验
*/
import cn.jobstart.pubInter.EnumVO;
import java.util.ArrayList;
import java.util.List;

public enum ResumeBasicWorkExperienceFlagEnum {

    ONE_DOWN(1, "1年以内") ,
    ONE_THREE(2, "1-3年") ,
    THREE_FIVE(3, "3-5年") ,
    FIVE_TEN(4, " 5-10年") ,
    TEN_UP(5, "10年以上") ; 




    private Integer type;
    private String desc;

    ResumeBasicWorkExperienceFlagEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByType(Integer type) {
        if(type==null ){
            type=0;
        }
        for (ResumeBasicWorkExperienceFlagEnum var : ResumeBasicWorkExperienceFlagEnum.values()) {
            if (type==var.getType().intValue())
                return var.getDesc();
             }
        return ResumeBasicWorkExperienceFlagEnum.values()[0].getDesc();
    }

    public static List<EnumVO> getDescs() {
        List list = new ArrayList();

        for (ResumeBasicWorkExperienceFlagEnum var : ResumeBasicWorkExperienceFlagEnum.values()) {
            EnumVO enumVO = new EnumVO();
            enumVO.setId(var.getType()+"");
            enumVO.setName(var.getDesc());
            list.add(enumVO);
        }


        return list;
    }

}
